<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderRefundsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_refunds', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('userid')->comment('用户ID');
            $table->integer('orderid')->comment('订单id');
            $table->string('ordernumber')->comment('订单号');
            $table->decimal('money', 16, 2)->comment('退款金额');
            $table->string('redenvelopeinfo')->comment('红包变更信息');
            $table->string('remark')->default('')->comment('退款备注');
            $table->decimal('startbalance', 16, 2)->default(0.00)->comment('退款前余额');
            $table->decimal('lastbalance', 16, 2)->default(0.00)->comment('退款后余额');
            $table->tinyInteger('status')->default(1)->comment('状态');
            $table->integer('adminid')->default(0)->comment('操作人id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('shop_coupons');
    }
}
